<template>
	<div class="toolbar" style="float:left;padding-top:0px;padding-left:1px;">
    <el-form :inline="true"  size="mini">
      <div class="toolbar" style="float:left;padding-top:0px;padding-left:1px;">
        <slot ></slot>
        <el-form-item>
               <kt-button icon="fa fa-search" :label="$t('action.search')"  :perms="pagePerm" type="primary" @click="myQuery()"/>
        </el-form-item>
        <el-form-item v-if="add" >
                <kt-button icon="fa fa-plus"    :label="$t('action.add')"   :perms="addPerm" type="primary"  @click="handleAdd" />
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>

<script>
import KtButton from "@/views/Core/KtButton"
  export default {
    name: 'SQuery',
    components:{
		  KtButton,
    },
    props: {
      perms: "",
      add:false,
   
    },
    data() {
      return {
          addPerm:"add",
          pagePerm:"view"
      }
    },
    methods: {
      myQuery:function (){ 
        this.$emit('click',1)
      },
      handleAdd:function (){ 
        this.$emit('addClick')
      }

    },
        created() {
          this.addPerm=this.perms+":add"
          this.pagePerm=this.perms+":view"
    }
  }
</script>
<style >
.action:hover {
  background: #636b6931;
}
</style>